#pragma once
#include "cupid.h"

namespace cupid
{

struct	MessageStatus
{
	int			m_from;
	int			m_packet;
	VAR_TYPE	m_varType;
	int 		m_error;
};

class IMessagePort
{
public:
	IMessagePort			() {}
	virtual ~IMessagePort	() {}

	virtual bool	isOpen	()		=	0;

public:

	virtual int		getID	()		=	0;

	virtual int		getSize	()		=	0;

	virtual bool	open	()		=	0;

	virtual bool	close	()		=	0;

	virtual bool	send	(int port, int packet, VAR_TYPE varType, const void* buf)		=	0;

	virtual bool	recv	(int port, int packet, VAR_TYPE varType, void* buf, MessageStatus* status)		=	0;

	virtual bool	waitMsg	(int sec = INFINITE) 		=	0;
};

}